package cn.hxzy.dao;

import cn.hxzy.entity.Member;
import cn.hxzy.entity.News;
import cn.hxzy.util.DataSource;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class MemberDao extends BaseDao<Member> {

//    public List<Member> findAllWithUser() throws SQLException {
//        Connection connection = DataSource.getConnection();
//        PreparedStatement statement = connection.prepareStatement("SELECT m.* FROM member m ");
//        ResultSet resultSet = statement.executeQuery();
//        List<Member> list = new ArrayList<>();
//        while (resultSet.next()) {
//            Member member = new Member(resultSet.getString("name"),resultSet.getInt("age"),resultSet.getString("image"),resultSet.getString("member_work"));
//            member.setId(resultSet.getInt("id"));
//            list.add(member);
//        }
//        resultSet.close();
//        statement.close();
//        DataSource.closeConnection(connection);
//        return list;
//
//    }
}
